Subject: Comments on the CD1.7 draft (3) - given id of 99-xxxx

Author: Robert Jones, email: 100621.553@compuserve.com

References:

1. Committee Draft 1.7 for the proposed revision of ISO 1989:1985, COBOL standard - PDF version. I use Adobe Acrobat Reader, version 3.

2. 99-0519 Comments on the CD1.6 Draft (2) by me.

3 99-0560 Comments on the CD1.7 Draft (1) by me.

Comments:

I would like to say that I think that the transformation of the developing standard from the content and layout of the previous standard is a great improvement.

All of these items except the last deal with the topic of separators and assumed spaces. The last is a question about arithmetic operators.

Space separators, space characters and the distinction

Discussion of the use of the character space as a separator and the use of the comma and semicolon as equivalents.

Any decisions made on this may affect decisions made on 99-0519 item 7 and 99-0560 items 15 and 16.

Also refer to "5.1.7 Punctuation" (also discussed below), which I think would be improved by an explicit reference to "8.3.2 Separators" and possibly vice-versa. I also think that 5.1.7 should contain a caveat to explain that certain formats and rules are further qualified for the situations where one or more space characters must be present in particular positions, e.g. "8.7.1 arithmetic operators", "8.7.3 relational operators" and perhaps the colon in reference modification, or where none is needed, such as unary arithmetic operators and parentheses in some circumstances. There may also be situations where separator commas and semicolons should be disallowed, such as within arithmetic, logical and conditional expressions.

I have started with 8.3.2, the other items are in the sequence of the standard. Apart from reference modification and operators, the others are fairly straightforward.

1 8.3.2 Separators, page 94

Items 1 and 2, especially the third sentence of item 1. While I think that this implies that separator commas and separator semicolons followed by a separator space are logically equivalent to a separator space, an explicit statement to say so might be desirable if it is true, otherwise a statement to the contrary would be helpful. "5.1.7 Punctuation" states that they are interchangeable. I am not keen on rules by implication, it is surprising how even the seemingly obvious can be ambiguous or misleading under certain circumstances.

Perhaps it is required that a distinction be made between the term "space" and "separator space", in that the first must be the character space, though it is still a separator, but may be part of another separator, while the latter may also be a separator comma or separator semicolon. If so, then perhaps this is the right place to specify it, perhaps the terms "separator space", "space characters" and "character space" should be used more generally within the standard where that is what is meant, including within 8.3.2. However, when doing so care must be take not to get confused with the assumed spaces that terminate source text lines that are not continued with a continuation indicator on the following line and the the assumed spaces that precede and succeed source text. Consistency of use would also make it easier to search the text of the standard.

I don't think it is desirable for separator commas and semicolons to be repeated together or separately, nor to follow separator periods. However, it is arguable that the standard should not be expected to deal with unreasonable misuse.

Having considered the above issues, I have provided a reworked text for 8.3.2, it is largely the same with a few relatively minor alterations.

********************************************************************

original text

(I have left this in to make it easier for reviewers to do a text compare to check my underlined changes, should they wish to do so.)

8.3.4 Separators

A separator is one of the following, except when appearing in a literal or picture character-string.

1) The COBOL character space is a separator. Anywhere a space is used as a separator or as part of a separator, more than one space may be used. All spaces immediately following the separators comma, semicolon or period are considered part of that separator and are not considered to be the separator space.

2) The COBOL characters comma and semicolon, immediately followed by a space, are separators that may be used anywhere the separator space is used. They may be used to improve readability.

3) The COBOL character period, when followed by a space is a separator. It shall be used only to indicate the end of a sentence, or as shown in formats.

4) The COBOL characters right and left parentheses are separators. Except in pseudo-text, parentheses may appear only in balanced pairs of left and right parentheses delimiting subscripts, a list of function or method arguments, reference modifiers, arithmetic or boolean expressions, or conditions.

5) The opening delimiters and closing delimiters of literals are separators. Either an apostrophe or a quotation mark may be used as the quotation symbol character in opening and closing delimiters.

The opening delimiters of literals are:

- a quotation symbol

- the two contiguous characters B", B', N", N', X" and X'

- the three contiguous characters BX", BX', NX" and NX'

The closing delimiters of literals are:

- a quotation symbol when the opening delimiter uses a quotation mark

- an apostrophe when the opening delimiter uses an apostrophe

The opening delimiter shall be immediately preceded by a space, left parenthesis, or opening pseudo-text delimiter. The closing delimiter shall be immediately followed by one of the separators space, comma, semicolon, period, right parenthesis, or closing pseudo-text delimiter. Separators immmediately preceding the opening delimiter are not part of the opening delimiter. Separators immediately following the closing delimiter are not part of the closing delimiter.

6) Pseudo-text delimiters are separators. An opening pseudo-text delimiter shall be immediately preceded by a space; a closing pseudo-text delimiter shall be immediately followed by one of the separators space, comma, semicolon, or period. Pseudo-text delimiters may appear only in balanced pairs delimiting pseudo-text.

7) The COBOL character colon, except as part of the invocation operator, is a separator and is required when shown in the general formats.

8) The separator space may optionally precede all separators except:

a) As specified by reference format rules (see 6, Reference format.)

b) The closing delimiter of a literal. In this case, a preceding space is considered as part of the literal and not as a separator

c) The opening pseudo-text delimiter, where the preceding space is required.

9) The separator space may optionally immediately follow any separator except the opening delimiter of a literal. A space following the opening delimiter of a literal shall be part of the literal and not a separator.

********************************************************************

text as revised for consideration

Suggested changes are underlined.

8.3.4 Separators

A separator is one of the following, except when appearing in a literal or picture character-string.

1) The space character is a separator. Anywhere a space character is used as a separator or as part of a separator, more than one space character may be used. All space characters immediately following the separators comma, semicolon or period are considered part of that separator and are not considered to be the separator space. An explanation of the situations where a space character shall be assumed to be present is given in 6, Reference format.

2) The COBOL characters comma and semicolon, immediately followed by a space character, are separators that may be used anywhere the separator space is used and with the same meaning. They may be used to improve readability.

3) The COBOL character period, when followed by a space character is a separator. It shall be used only to indicate the end of a sentence, or as shown in formats.

4) The COBOL characters right and left parentheses are separators. Except in pseudo-text, parentheses may appear only in balanced pairs of left and right parentheses delimiting subscripts, a list of function or method arguments, reference modifiers, arithmetic or boolean expressions, or conditions.

5) The opening delimiters and closing delimiters of literals are separators. Either an apostrophe or a quotation mark may be used as the quotation symbol character in opening and closing delimiters.

The opening delimiters of literals are:

- a quotation symbol

- the two contiguous characters B", B', N", N', X" and X'

- the three contiguous characters BX", BX', NX" and NX'

The closing delimiters of literals are:

- a quotation symbol when the opening delimiter uses a quotation mark

- an apostrophe when the opening delimiter uses an apostrophe

The opening delimiter shall be immediately preceded by a space character, left parenthesis, or opening pseudo-text delimiter. The closing delimiter shall be immediately followed by one of the separators space, comma, semicolon, period, right parenthesis, or closing pseudo-text delimiter. Separators immmediately preceding the opening delimiter are not part of the opening delimiter. Separators immediately following the closing delimiter are not part of the closing delimiter.

6) Pseudo-text delimiters are separators. An opening pseudo-text delimiter shall be immediately preceded by a space character; a closing pseudo-text delimiter shall be immediately followed by one of the separators space, comma, semicolon, or period. Pseudo-text delimiters may appear only in balanced pairs delimiting pseudo-text.

7) The COBOL character colon, except as part of the invocation operator, is a separator and is required when shown in the general formats.

8) The separator space may optionally precede all separators except:

a) As specified by reference format rules (see 6, Reference format.)

b) The closing delimiter of a literal. In this case, a preceding space character is considered as part of the literal and not as a separator

c) The opening pseudo-text delimiter, where the preceding space character is required.

d) the period following the end of a picture character-string, when that picture character-string is the last item of a data description entry and is terminated by a comma or period.

9) The separator space may optionally immediately follow any separator except the opening delimiter of a literal. A space character following the opening delimiter of a literal shall be part of the literal and not a separator.

2 Use of terms "separator space" and "space character" - generally

While most of the following items relate to tidying up the terminology, there are still residual cases where the unqualified terms "space" or "spaces" are the appropriate form. There are several cases where the term "non-space" is used and for which "non-blank" might be preferable. The term "non-blank" is also already used for similar purposes, as is "nonblank" without the hyphen, "nonspace" without the hyphen and "non space" with the intervening blank. The term "space-filled" is used in several places, where perhaps "blank" or "filled with space characters" might be better in some but not all cases.

3 Definitions, 4.130, Debugging indicator, page 14

Replace "followed by a space" by "followed by a space character".

4 Description techniques, 5.1.7 Punctuation, page 34

Consider whether this should specify the type of COBOL word that a separator comma or semicolon is allowed to follow or precede, e.g. not operators, though there are cases where that is acceptable. Perhaps it should state that while generally true, there are exceptions for particular situations that are specified where appropriate.

5 Reference format, 6.1.2, Floating indicators, page 37

Under the description for "compiler description" replace "intervening space" by "intervening space character".

6 Reference format, 6.1.3, Floating indicators, Syntax rules, page 37

Rule 1, replace "space" by "space character".

7 Reference format, 6.2.3, Program-text area, page 39

Last line, replace "spaces" by "space characters".

8 Reference format, 6.2.4, Continuation of lines, page 39

In the seventh text block, commencing "In the case of continuation ...", replace "spaces" by "space characters".

In the last paragraph, replace "space" by "space character".

9 Reference format, 6.3.1, Continuation of lines, page 40

Last word of first para, replace "space" by "space character".

Second para, fifth line, replace "spaces or one or more spaces" by "space characters or one or more space characters".

10 Reference format, 6.3.4, Debugging of lines, page 41

First para, first line, replace "space" by "space character".

11 Reference format, 6.4, Logical conversion, page 42

Item 3, replace "spaces" by "space characters".

Item 5, replace "space" by "space character".

12 Text manipulation elements, 7.1.1.4, Text-words, page 46

Item 1, first line, replace "space" by "space character".

13 COPY statement, 7.1.2.2, Syntax rules, page 47

Rule 2, replace "space" by "space character".

14 COPY statement, 7.1.2.3, General rules, page 48

Rule 8a, second line, replace "space" by "space character".

Rule 8c1, second line and third lines, replace "single space" by "single space character".

Rule 8c5, replace "space" by "space character".

Rule 10, replace the four instances of "space" and "spaces" by "space character" and "space characters" respectively, including the note.

15 REPLACE statement, 7.1.3.2, Syntax rules, page 51

Rule 2, replace "space" by "space character".

16 REPLACE statement, 7.1.3.3, General rules, page 52

Rule 10c1, second line and third lines, replace "single space" by "single space character".

Rule 10c5, replace "space" by "space character".

Rule 12, replace the four instances of "space" and "spaces" by "space character" and "space characters" respectively, including the note.

17 Compiler directives, 7.2.2, Syntax rules, page 54

Rule 5, while the meaning is the same, I think that "the COBOL character space" could be replaced by "a space character", this would make text searches easier and be more consistent with the rest of the standard.

Rule 5, third line, replace both instances of "space" by "space characters".

18 Character strings, 8.3.1.2.2.2, Floating-point literals, page 88

Item 1, replace "spaces" by "intervening space characters".

19 Character strings, 8.3.1.2.5.3, Figurative constant values, General rules, page 93

Rule 2, while there is nothing wrong with the existing text, consider replacing "of the character space" by "space characters" for consistency with terminology elsewhere and making text searching easier.

20 Identifiers, 8.4.2.3, Reference modifier, page 105

Consider whether it is desirable to introduce a new syntax rule, for consistency with other operators and general readability as follows:

The colon character between the leftmost position and the length shall be immediately preceded and followed by one or more space characters.

As currently specified by the general format, it is separated from its operands by separator spaces, which could be interchanged with separator commas or semicolons.

As the colon is a separator, it is arguable that no separators are required between it and its operands or the right parenthesis, but this is not what is shown in the general format. This is the only use of the colon as a separator, though it is also allowed in picture character-strings.

21 Operators, 8.7, generally, page 129

Consider whether all operators should be separated from their operands in the same way. Consider whether it should be permissible for separator commas and semicolons to be interposed as per "5.1.7 Punctuation", as long as a space character precedes and follows an operator. Maybe rules for the separation of operators from operands should be specified here rather than individually, though attention must be given to the cases where an operator has only one operand and where no space is required between an operator and a parenthesis.

E.g. "Operators shall be separated from their operands by only one or more space characters and shall in any case be preceded and followed by a space character, except that unary arithmetic operators may immediately precede a left parenthesis, or immediately succeed a right parenthesis."

Also consider in conjunction with "8.8.4.2 Complex conditions".

Even if it is decided that the separation of operands and operators should be dealt with separately by type, a general view before deciding on individual cases would be desirable, especially when deciding how to treat combinations of different types of expression.

I have also made tentative suggestions for the individual types of operator separately.

22 Operators, 8.7.1, Arithmetic operators, page 129

First para, second and third lines, replace all three instances of "space" by "space character".

Consider whether such space characters can be preceded or followed by the separator comma or semicolon as per "5.1.7 Punctuation".

23 Operators, 8.7.2, Boolean operators, page 129

Consider whether it is desirable to specify that boolean operators be separated from their operands by space characters. E.g. insert as a second sentence "A boolean operator shall be preceded and followed by a space character, except that the B-NOT operator may be immediately preceded by a left parenthesis.".

24 Operators, 8.7.3, Concatenation operator, page 129

Consider whether separator spaces are appropriate. Might it be preferable to require space characters as per arithmetic and relational operators for consistency with other operators? E.g. replace "separator space" by "space character". However, for concatenation operators the use of preceding separator commas and semicolons would seem quite reasonable, so maybe no change is required.

25 Operators, 8.7.4, Invocation operator, page 129

Consider whether separator spaces are appropriate. Might it be preferable to require space characters as per arithmetic and relational operators? E.g. replace "separator space" by "space character".

26 Operators, 8.7.5, Relational operators, page 129

First para, first line, replace "space" by "space character".

Consider whether such space characters can be preceded or followed by the separator comma or semicolon as per "5.1.7 Punctuation".

27 Operators, 8.7.6, Logical operators, page 130

Dealt with in 8.8.4.2

28 Conditional expressions, 8.8.4.1.1.6.1, Standard comparison, page 139

Item 2, second line, consider replacing "spaces" by "space characters", while the context makes the meaning clear, text searches of the standard would be easier for the change.

29 Conditional expressions, 8.8.4.1.1.6.2, Locale-based comparison, page 139

First para and following note, for the same reason, consider replacing all four instances of "space" and "spaces" by "space character" and "space characters" respectively.

30 Conditional expressions, 8.8.4.1.1.8.1, Standard comparison, page 140

Item 2, second line, consider replacing "spaces" by "space characters", while the context makes the meaning clear, text searches of the standard would be easier for the change.

31 Conditional expressions, 8.8.4.1.1.8.2, Locale-based comparison, page 139

First para and following note, for the same reason, consider replacing all four instances of "space" and "spaces" by "space character" and "space characters" respectively.

32 Class condition, 8.8.4.1.3.3, General rules, page 143

Rule 3b, consider replacing the last word "spaces" by "space characters", the meaning is currently clear, but text searches would be easier for the change.

33 Conditional expressions, 8.8.4.2, Complex conditions, page 145

Last para, replace both instances of "space" by "space character".

Also perhaps add ", except that the NOT operator may be immediately preceded by a left parenthesis.".

34 SOURCE-COMPUTER paragraph, 12.2.4.2, General rules, page 200

Rule 4, last word, replace "spaces" by "space characters".

35 SPECIAL-NAMES, 12.2.6.2, Syntax rules, page 208

Rule 20b, consider replacing "space" by "space character".

Rule 24b, consider replacing "space" by "space character".

36 BLANK WHEN ZERO clause, 13.16.10.3, General rules, page 281

Rule 1, consider replacing "spaces" by "space characters".

37 COLUMN clause, 13.16.16.3, General rules, page 290

Consider replacing "blank characters" by "space characters".

38 DEFAULT clause, 13.16.18, introduction, page 294

Consider replacing "spaces" by "space characters".

39 DEFAULT clause, 13.16.18.3, General rules, page 294

Rule 1a, 1b & 1c, consider replacing the three terminating words "spaces" by "space characters".

Rule 4, consider replacing "spaces" by "space characters".

40 FULL clause, 13.16.27.2, General rules, page 306

Rule 3, first line, consider replacing "spaces" by "space characters".

41 JUSTIFIED clause, 13.16.33.3, General rules, page 312

Rule 2, should the two instances of "SPACES" be capitalised, should they be replaced by "space characters".

42 PICTURE clause, 13.16.41.3, General rules, page 334

Rule 11b, second line, replace "spaces" by "space characters".

Rule 12, for "B", consider replacing "character space" by "space character".

Rule 12, for "Z", consider replacing "character space" by "space character".

Rule 13, for "B", consider replacing "character space" by "space character" for both instances.

Rule 13, for "Z", consider replacing "character space" by "space character" for both instances.

Rule 16, for "Z", consider replacing "character space" by "space character".

43 PICTURE clause, 13.16.41.4, Editing rules, page 339

Rule 1, penultimate line, consider replacing "spaces" by "space characters".

Rule 8, second line, consider replacing "character space" by "space character".

Rule 8b, fourth and fifth line, consider replacing "character space" by "space character".

44 SUM Clause, 13.16.55.3, General rules, page 369

Rule 4, consider replacing "spaces" by "space characters".

45 Procedures, 14.5.2, Paragraphs, page 398

First line, consider replacing "period and a space" by "separator period". Already suggested by item 16 of 99-571.

46 MERGE statement, 14.10.23.3, General rules, page 483

Rules 2 and 13, consider replacing "space-filled" by "padded". The meaning is still clear because both the sentences go on to say that "alphanumeric space characters" are to be used for the purpose.

47 SORT statement, 14.10.36.3, General rules, page 483

Rules 6 and 15, consider replacing "space-filled" by "padded". The meaning is still clear because both the sentences go on to say that "alphanumeric space characters" are to be used for the purpose.

48 VALIDATE statement, 14.10.46.3, General rules, page 564

Rule 8, last word, consider replacing "spaces" by "space characters".

49 EXCEPTION-FILE function, 15.23.2, Returned values, page 597

Fifth and sixth lines, consider replacing "spaces" by "space characters".

50 EXCEPTION-LOCATION function, 15.24.2, Returned values, page 598

Rule 1, consider replacing "space" by "space character".

Rule 2, first para, line 4, consider replacing "space" by "space character".

Rule 2b, consider replacing the three instances of "space" by "space character".

51 EXCEPTION-STATEMENT function, 15.25.2, Returned values, page 599

Rule 1, consider replacing "spaces" by "space characters".

52 EXCEPTION-STATUS function, 15.26.2, Returned values, page 600

Rule 1, consider replacing both instances of "spaces" by "space characters".

53 LOCALE-COMPARE, 15.38.3, Returned values, page 612

Rule 2, consider replacing both instances of "spaces" by "space characters" and "space" by "space characters".

54 NATIONAL-OF, 15.51.3, Returned values, page 625

Rule 3, consider replacing "space" by "space character".

55 NUMVAL, 15.52, introduction, page 626

Consider replacing "spaces" by "space characters".

56 NUMVAL-C, 15.53, Arguments, page 627

Rule 2, consider replacing "spaces" by "space characters".

Rule 6a, top line of page 628, consider replacing "space" by "space character" and "spaces" by "space characters".

Rule 7b7, consider replacing "spaces" by "space characters".

57 NUMVAL-F, 15.54, introduction, page 628

Consider replacing "spaces" by "space characters".

58 NUMVAL-F, 15.54.2, Arguments, page 629

Rule 1, text block following subsidiary format, consider replacing the second instance of "space" by "space character".

59 NUMVAL-F, 15.54.3, Returned values, page 629

Rule 1, consider replacing "spaces" by "space characters".

60 STANDARD-COMPARE function, 15.67.3, Returned values, page 642

Rule 3, consider replacing both instances of "spaces" by "space characters" and "space" by "space characters".

61 TEST-NUMVAL, 15.73.3, Returned values, page 648

Rule 1b, note 1, consider replacing "spaces" by "space characters".

62 TEST-NUMVAL-C, 15.74.2, Arguments, page 649

Rule 2, consider replacing "spaces" by "space characters".

63 TEST-NUMVAL-C, 15.74.3, Returned values, page 649

Rule 1b, note 1, consider replacing "spaces" by "space characters".

64 TEST-NUMVAL-F, 15.75.2, Returned values, page 650

Rule 1d, note 1, consider replacing "spaces" by "space characters".

65 COMMUNICATIONS facility, A.1.2.3, General rules, page 662

Rule 3, consider replacing "shall contain spaces" by "shall be all space characters". The start of the sentence "The contents of ..." already provides the meaning provided by "contain".

Rule 5, consider replacing "spaces" by "space characters".

Rule 6, first para, last line, consider replacing "spaces" by "all space characters".

Rule 6, second para, consider replacing "spaces" by "all space characters".

Rule 10, last word, consider replacing "spaces" by "all space characters".

Rule 28, second and third paragraphs, last word, consider replacing "spaces" by "all space characters".

66 Report writer, C.18.3.3, Column, page 797

Seventh line, consider replacing "spaces" by "space characters".

67 Report writer, C.18.4.1, PRESENT WHEN, page 798

Second para, consider replacing "spaces" by "space characters".

Eighth para, consider replacing "spaces" by "space characters".

68 Validate facility, C.19.1, Format validation, page 802

First para, third line, consider replacing "spaces" by "space characters".

69 D.2, Substantive changes not affecting existing programs, page 833

Item 5, Arithmetic operators, consider replacing "space" by "space character".

*****************************************************************************

Arithmetic operators

70 Operators, 8.7.1, Arithmetic operators, page 129

How should the expression (A - - -2) be evaluated? I think it means that the signed numeric literal -2 is negated by the prior unary minus sign and that the result is subtracted from the identifier A.

Arguably, it is up to the user to construct appropriate arithmetic expressions for the task in hand.

Also see "8.8.1 Arithmetic expressions".